<?php

/*
* Returns the value of a session variable.
*/
function getSessionVariable($var) 
{
	if (isset($_SESSION[$var]))
	{
		return $_SESSION[$var];
	}
	
	return null;
}

/*
* Sets the value of a session variable.
*/
function setSessionVariable($var, $value)
{
	$_SESSION[$var] = $value;
	
	if (getSessionVariable($var) == $value)
	{
		return true;
	}
	
	return false;
}

/*
* Returns the value of a form variable.
*/
function getFormVariable($var)
{
	if (isset($_POST[$var]))
	{
		return $_POST[$var];
	}
	
	return null;
}

/*
* Returns the value of a query string variable.
*/
function getQueryStringVariable($var)
{
	if (isset($_GET[$var]))
	{
		return $_GET[$var];
	}
	
	return null;
}

/*
* Returns a file object collected by a form.
*/
function getFormFile($fileName)
{
	if (isset($_FILES[$fileName]))
	{
		return $_FILES[$fileName];
	}

	return null;
}

?>
